home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Estrategia / ant_war.swf / scripts / DefineButton2_886 / BUTTONCONDACTION on(press).as
Encoding:
Text File  |  2007-03-13  |  765 b   |  28 lines

  1. on(press){
  2.    var ii = _root.statenemyindex;
  3.    var ok = true;
  4.    var caption = "Click to Cycle";
  5.    var myColor;
  6.    while(ok)
  7.    {
  8.       ii--;
  9.       if(ii < 0)
  10.       {
  11.          ii = _root.enemiesencountered.length - 1;
  12.       }
  13.       if(ii == _root.statenemyindex)
  14.       {
  15.          ok = false;
  16.          caption = ii != 0 ? _root.enemylist[ii][gc_elname] : "Click to Cycle";
  17.       }
  18.       else if(!isNaN(parseInt(_root.enemiesencountered[ii])) && _root.enemiesencountered[ii] > -1)
  19.       {
  20.          ok = false;
  21.          caption = _root.enemylist[ii][gc_elname];
  22.       }
  23.    }
  24.    _root.statenemyindex = ii;
  25.    _root.stats_enemiesencountered = caption;
  26.    _root.statenemyclip.gotoAndPlay("event_" + parseInt(_root.enemiesencountered[ii]));
  27. }
  28.